<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <title>登录</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" th:href="@{/x-admin/css/font.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/x-admin/css/login.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/x-admin/css/xadmin.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/x-admin/lib/layui/css/layui.css}">
</head>
<body class="login-bg">
<div class="login layui-anim layui-anim-up">
    <div class="message">广软课室申请系统</div>
    <div id="darkbannerwrap"></div>
    <form th:action="@{/userLogin}" th:method="post" class="layui-form">
        <input name="account" placeholder="用户名" type="text" lay-verify="required" class="layui-input">
        <hr class="hr15"/>
        <input name="password" lay-verify="required" placeholder="密码" type="password" class="layui-input">
        <hr class="hr15"/>
        <input name="checkcode" id="code_input" lay-verify="required" placeholder="验证码" type="text" class="layui-input">
        <hr class="hr15"/>
        <div id="v_container" style="width: 200px;height: 50px;"></div>
        <hr class="hr12">
        <input value="登录" id="my_button" lay-submit lay-filter="login" style="width:100%;" type="submit">
        <hr class="hr15"/>
        <div th:if="${param.error}">
            <p style="color: red">账号或密码错误!!!</p>
            <hr class="hr15"/>
        </div>
    </form>
    <input type="checkbox" name="rememberme" lay-skin="primary">记住我
</div>
</body>
<script th:src="@{/x-admin/js/gVerify.js}"></script>
<script>
    let verifyCode = new GVerify("v_container");
    document.getElementById("my_button").onclick = function () {
        let res = verifyCode.validate(document.getElementById("code_input").value);
        if (res) {
            return true;
        } else {
            alert("验证码错误");
            return false;
        }
    }
</script>
</html>
